package edu.zut.cs.javaee.manager.student.domain;
/**
 * 
 * @author weining
 *
 */
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;

import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import javax.persistence.FetchType;
 
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import java.util.List;
import edu.zut.cs.javaee.manager.base.domain.BaseEntity;
import edu.zut.cs.javaee.manager.checkwork.domain.CheckWork;

@Table(name = "T_Student")
@Entity
@NamedQueries({ @NamedQuery(name = "Student.getRoot", query = "select m from Student m ") })
public class Student extends BaseEntity<Long> {
	/**
	 * 
	 */
	private static final long serialVersionUID = -9015100869700765303L;
	@Column
	String name;
	@Column
	int age;
	@Column
	Long s_id;

	@Column
	Long code;

	

	@Column
	String gender;
	@Column
	String group1;

	/**
	 * one->many
	 * 
	 * @author laiweining
	 */
	@OneToMany(mappedBy = "student", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
	List<Monitor> monitors;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public Long getId() {
		return code;
	}

	public void setId(Long i) {
		this.code = i;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getGroup() {
		return group1;
	}

	public void setGroup(String group) {
		this.group1 = group;
	}

	 

	 

	  
}
